import React from "react";
import { useGlobalStore } from "@/store/global";
import { useShallow } from "zustand/react/shallow";

const Maximize: React.FC = () => {
  const { maximize, setGlobalState } = useGlobalStore(useShallow((state) => ({ maximize: state.maximize, setGlobalState: state.setGlobalState })));

  return (
    <React.Fragment>
      {maximize && (
        <div className="maximize-icon" onClick={() => setGlobalState({ key: "maximize", value: false })}>
          <i className="iconfont icon-tuichu"></i>;
        </div>
      )}
    </React.Fragment>
  );
};

export default Maximize;
